package cn.cvs.service.impl;

import cn.cvs.mapper.sysrole.SysRoleMapper;
import cn.cvs.pojo.SysRole;
import cn.cvs.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author: 邓必宏
 * @title:
 * @Demo:
 * @DateTime: 2023/10/18
 */
@Transactional
@Service("sysRoleService")
public class SysRoleServiceImpl implements SysRoleService {

    @Autowired
    SysRoleMapper sysRoleMapper;

    @Override
    public List<SysRole> getSysRoleList() {
        return sysRoleMapper.getSysRoleList ();
    }

    @Override
    public int update(SysRole sysRole) {
        return sysRoleMapper.update ( sysRole );
    }

    @Override
    public int delete(List<Integer> ids) {
        return sysRoleMapper.delete ( ids );
    }

    @Override
    public int add(SysRole sysRole) {
        return sysRoleMapper.add ( sysRole );
    }

    @Override
    public SysRole getSysRoleById(Integer id) {
        return sysRoleMapper.getSysRoleById ( id );
    }

    @Override
    public List<SysRole> getSysRoleAllListPage(Integer pageNo, Integer pageSize) {
        return sysRoleMapper.getSysRoleAllListPage ( (pageNo-1)*pageSize,pageSize );
    }

    @Override
    public int getCount() {
        return sysRoleMapper.getCount (  );
    }

    @Override
    public SysRole checkCodeExist(String code) {
        return sysRoleMapper.checkCodeExist ( code );
    }


    public SysRoleMapper getSysRoleMapper() {
        return sysRoleMapper;
    }

    public void setSysRoleMapper(SysRoleMapper sysRoleMapper) {
        this.sysRoleMapper = sysRoleMapper;
    }
}
